﻿using System;
using System.ServiceProcess;

namespace ServiceHost
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            var svc = new ServiceHost();
            if (Environment.UserInteractive)
            {
                svc.StartManuel();
                Console.WriteLine("Press any key to stop program");
                Console.Read(); 
                svc.StopManuel();
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new ServiceHost() };
                ServiceBase.Run(servicesToRun);
            }
        }
    }
}
